package cn.mashiro.common.execption;

import cn.mashiro.common.enums.ResultCode;

public class ServiceException extends RuntimeException {
    private int code = ResultCode.ERROR.getCode();

    private final String message;

    public ServiceException(String message) {
        this.message = message;
    }

    public ServiceException(ResultCode resultCode) {
        this.code = resultCode.getCode();
        this.message = resultCode.getMessage();
    }

    public int getCode() {
        return code;
    }

    @Override
    public String getMessage() {
        return message;
    }
}
